#include <stdio.h>
#include <time.h>

int main(){
    time_t tp = 0;
    time_t tn = 0;
    struct tm *tmp = 0;
    time(&tp);
    printf(" %s \n","开始程序了");
    
    printf("time():%ld\n",tp);
    

    tmp = localtime(&tp);
    tn = mktime(tmp);
    printf("time()->localtime()->mktime(): %ld\n", tn);
    tmp = gmtime(&tp);
    tn = mktime(tmp);
    printf("time()->gmtime()->mktime(): %ld\n", tn);
    char dt[12];
    strftime(dt,12,"%Y-%m-%d:",tmp);
    printf(" %s \n",dt);
}

